<!-- 我的车场加盟信息 -->
<template>
  <view class="parking-join">
    <view class="container">
      <!-- 空状态 -->
      <view v-if="list.length === 0" class="empty-state">
        <text>暂无加盟信息</text>
      </view>

      <!-- 列表内容 -->
      <view v-else class="join-list">
        <view v-for="(item, index) in list" :key="index" class="join-item">
          <view class="parking-name">{{ item.parkingLotName || '未命名车场' }}</view>
          <view class="info-row">城市：{{ item.city }}</view>
          <view class="info-row">车场地址：{{ item.parkingIotAddress }}</view>
          <view class="info-row">联系人：{{ item.contactPerson }}</view>
          <view class="info-row">联系电话：{{ item.contactPhone }}</view>
          <view class="info-row">收费标准：{{ item.chargingStandard }}元/小时</view>
          <view class="submit-time">提交时间：{{ item.creatorTime }}</view>
        </view>
      </view>
    </view>
    <view class="form-actions">
      <u-button
        type="primary"
        @click="goJoinParking"
        customStyle="margin-bottom: 20rpx;"
        >提交加盟信息</u-button
      >
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      list: [],
    };
  },
  onLoad() {
    this.getJoinParkingList();
  },
  methods: {
    goJoinParking() {
      uni.navigateTo({
        url: "/pages/user/userJoinParking",
      });
    },
    getJoinParkingList() {
      this.$httpReq.getQueryOneselfListCar().then((res) => {
        console.log(res);
        this.list = res.data;
      });
    },
  },
};
</script>

<style lang="scss" scoped>
.parking-join {
  padding: 20rpx;
  background: #F4F4F4;
  height: 100vh;

  .empty-state {
    text-align: center;
    padding: 40rpx;
    color: #999;
  }

  .join-list {
    .join-item {
      background: #fff;
      padding: 20rpx;
      border-radius: 8rpx;
      margin-bottom: 20rpx;

      .parking-name {
        font-size: 32rpx;
        font-weight: bold;
        margin-bottom: 16rpx;
      }

      .info-row {
        font-size: 28rpx;
        color: #333;
        margin-bottom: 12rpx;
      }

      .submit-time {
        font-size: 24rpx;
        color: #999;
        text-align: right;
      }
    }
  }
  .form-actions {
    position: fixed;
    bottom: 40rpx;
    left: 20rpx;
    right: 20rpx;
  }
}
</style>
